using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Templates;
using DevExpress.ExpressApp.Utils;
using DevExpress.XtraBars;
using DevExpress.ExpressApp.Win.Templates.ActionContainers;
using DevExpress.XtraBars.Ribbon;
using DevExpress.ExpressApp.Model;
using DevExpress.ExpressApp.Demos;
using DevExpress.ExpressApp.Win.Templates;

namespace FeatureCenter.Module.Win.Templates {
    public partial class DetailViewForm : DevExpress.ExpressApp.Win.Templates.XtraFormTemplateBase, ISupportClassicToRibbonTransform, IHintTemplate, IInfoPanelTemplate, ICaptionPanelHolder {
        protected override void OnLoad(EventArgs e) {
            base.OnLoad(e);
            CheckTransformToRibbon(false);
        }
        protected override IModelFormState GetFormStateNode() {
            if(View != null) {
                return TemplatesHelper.GetFormStateNode(View.Id);
            }
            else {
                return base.GetFormStateNode();
            }
        }
        public override void SetSettings(IModelTemplate modelTemplate) {
            base.SetSettings(modelTemplate);
            formStateModelSynchronizerComponent.Model = GetFormStateNode();
        }
        public DetailViewForm() {
            InitializeComponent();
            actionsContainersManager.ActionContainerComponents.AddRange(new IActionContainer[] {
			    cAbout, cTools, cFile, cObjectsCreation, cSave, cReports, cEdit, cOpenObject, cUndoRedo, cPrint, cExport, cRecordEdit, 
			    cRecordsNavigation, cSearch, cFullTextSearch, cFilters,
			    cDiagnostic, cOptions, cClose, cMenu, cView
		    });
            actionsContainersManager.DefaultContainer = cView;
            actionsContainersManager.ContextMenuContainers.AddRange(new IActionContainer[] { cObjectsCreation, cSave, cEdit, cOpenObject, cUndoRedo, cReports, cClose, cRecordEdit, cView, cPrint, cExport, cMenu });
            viewSiteManager.ViewSiteControl = viewSitePanel;
            BarManager = mainBarManager;
        }
        public Bar MainMenuBar {
            get { return _mainMenuBar; }
        }
        public Bar ToolBar {
            get { return standardToolBar; }
        }
        public Bar ClassicStatusBar {
            get { return _statusBar; }
        }

        #region IHintTemplate Members
        public string Hint {
            get {
                return hintPanel.Text;
            }
            set {
                hintPanel.Text = value;
                hintPanel.Visible = !string.IsNullOrEmpty(value);
            }
        }
        #endregion

        #region IInfoPanelTemplate Members
        DevExpress.XtraEditors.SplitContainerControl IInfoPanelTemplate.SplitContainer {
            get { return splitContainerControl; }
        }
        #endregion

        #region ICaptionPanelHolder Members
        public DevExpress.Utils.Frames.ApplicationCaption8_1 CaptionPanel {
            get { return applicationCaptionPanel; }
        }
        #endregion
    }
    [System.ComponentModel.DisplayName("FeatureCenter DetailViewForm Template")]
    public class FeatureCenterDetailViewFormTemplateLocalizer : FrameTemplateLocalizer<DetailViewForm> { }
}
